home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / Istar.lha / Docs / Driving Istar < prev    next >
Encoding:
Text File  |  1997-02-10  |  23.1 KB  |  485 lines

  1. DRIVING ISTAR
  2.  
  3. WHAT DO I NEED TO START IT?
  4.  
  5. Normally you don't need to bother about this lot as they are set up during 
  6. installation and Amiga startup.  But if something goes wrong then this list 
  7. might help.
  8.  
  9. #  assign KBTools: to some directory for best effect
  10. #  assign IstarSys: to some directory for prefs files (and, in future, 
  11. other things)
  12. #  iff.library (can run without it)
  13. #  asl.library is needed for saving etc. (supplied with Amiga 1200)
  14. #  Fonts needed depends now on IstarSys:IstarPrefs but the defaults are:
  15.       #  Courier 11
  16.       #  Garnet 16
  17. (all supplied with standard 1200).
  18.  
  19. HOW DO I START IT?
  20.  
  21. This describes the normal start of Istar, from WorkBench.
  22.  
  23. (If you are operating with low memory, such as a base A1200, then refer to 
  24. the section below on 'Starting with Low Memory'.  If you start from CLI, a 
  25. few options are available in Version 1.04 onwards; see later.)
  26.  
  27. Note:  Bold is often used for concepts and jargon terms used in Istar when 
  28. they are first used.  Italics is often used for some action you should 
  29. take.  'Oops' is used to tell you what to do if things don't seem to be 
  30. going as expected.
  31.  
  32.  
  33. 1.  Double click on the Istar icon.
  34.  
  35. 2.  You will be presented with a grey Control Screen part way up the view. 
  36. Initially this has 'Istar' on its title bar but that is soon obscured by a 
  37. horizontal strip and, at the left, the Initial Control Panel.
  38.  
  39. 3.  Click the 'New' button, and two things will happen.  First another 
  40. screen, a large blank white one appears.  This is the Easel on which you 
  41. draw your KB (knowledge base).  And, on the Control Screen, another panel 
  42. appears with columns of buttons and two list gadgets.  (If you are 
  43. operating with limited memory, the standard Easel size (30 by 24 inches) 
  44. might be too large, and you will have to alter the Prefs before clicking 
  45. the New button.)
  46.  
  47. Here are a few instructions to get you started ...
  48.  
  49. 4.  Move the mouse pointer up over the large white Easel then press left 
  50. mouse button (LMB) and keep it down.  A box appears that moves with the 
  51. mouse.  Move the mouse around.  Then release LMB.  (Oops:  No box appears. 
  52. Have you clicked rather than press, drag, release?  Do not click it; 
  53. clicking does something else.)
  54.  
  55. 5.  Draw another box, in the same way, to the right of first one.
  56.  
  57. 6.  Move the mouse pointer tip over the right hand edge of the left-hand 
  58. box, and press LMB while over the edge.  You will see a short line appear 
  59. from your mouse pointer to a point one quarter the way into the box.  This 
  60. line follows the mouse as you move it.  Move mouse around until line is 
  61. over the other (right-most) box and release LMB.  (The left-hand box is 
  62. called the antecedent of the right, and the right is the consequent of the 
  63. left.)  (Oops:  No line appears, but the box moves?  You had the mouse 
  64. pointer too far into the box, not exactly over the right-hand edge.  Oops: 
  65. A new box appears?  You had the mouse pointer too far outside the box, not 
  66. exactly over the right-hand edge.  In either case hit Escape key; see 7 
  67. below.)
  68.  
  69. 6a.  (If you wish, you can draw the line in the reverse direction: from the 
  70. left-hand edge of the right-most box leftwards to the left-most box.)
  71.  
  72. 6b.  If you want to insert a bend in your line, hit Space bar when end of 
  73. line is where you want the bend.
  74.  
  75. 7.  (To escape from any operation you have started but don't want, hit the 
  76. Escape key.  Then release the mouse button.)
  77.  
  78. That's the basic mechanism, and the whole knowledge base can be drawn like 
  79. that.  Not too bad, is it?
  80.  
  81.  
  82. GOING FURTHER
  83.  
  84. 8.  Various modifications of the diagram are possible:
  85.  
  86.       a)  Move a box by pressing LMB over the centre of the box.  Dotted
  87.       skeleton of the box and all its connecting links appears.  Move mouse
  88.       and this lot follows.  Release in new position.  (Note that boxes can
  89.       overlap, though it is usually not wise to do so; overlapping is
  90.       usually reserved to collections of boxes that are closely related
  91.       semantically.)  (Oops:  No dotted skeleton appears.  If a new line
  92.       appears then you have pressed the LMB while over a right- or left-
  93.       hand edge of the box, not near its middle.  Hit Escape and try
  94.       again.)
  95.  
  96.       b)  Bend a drawn link by pressing LMB over a link.  Dotted bent line
  97.       follows mouse to new position; release.  Pressing LMB over existing
  98.       bend will just move the bend to new position.  (Oops:  line doesn't
  99.       bend, but a box appears instead?  You were not near enough to the
  100.       line when you pressed LMB.  Hit Escape and try again.)
  101.  
  102.       c)  (Other modifications are possible e.g. to redirect a link to
  103.       another box, or to delete a box, delete a link, delete a bend from a
  104.       link:  see below.)
  105.  
  106. 9a.  Entering detail, e.g. Name and Meaning.  Click the Right Mouse Button 
  107. (RMB) over centre of box.  (Oops:  If you get a dotted box outline as in 
  108. 8(a) then you haven't clicked fast enough; hit escape key, release MB and 
  109. try again.  You'll soon get the hang of it.)  Up comes the Control Screen, 
  110. showing an Attribute Detail panel with around fifty gadgets.  Don't panic: 
  111. you need only the top two: Label and Meaning; ignore the others for now. 
  112. (Oops:  If a small panel comes up with half a dozen buttons - the Action 
  113. panel - then you have clicked the wrong MB; as we shall see below, this 
  114. comes up when you click the LMB rather than the RMB.  Hit 'Done' button 
  115. with the LMB to send it away and try again.)
  116.  
  117. 9b.  Along top of panel are two string gadgets which allow you to enter a 
  118. name for the box and a longer meaning if you wish.  For now, type something 
  119. in Label string, press Return and carry on typing in Meaning string - type 
  120. anything that you like.  Then click the OK button.  The Control Screen 
  121. returns and your box should display the new name.  (Oops:  If you try to 
  122. type and nothing enters either string then click LMB over the string you 
  123. wish to type in.)
  124.  
  125. 10.  Showing Meaning.  On the Easel, move the mouse over the box (do not 
  126. press any mouse button).  The Meaning text should appear in the horizontal 
  127. window in the top of the Control Screen.  Move mouse away, and it 
  128. disappears.  In this way, even when the box label text is too small to read 
  129. you can easily see what a box means.
  130.  
  131. 10a.  (Oops:  Nothing happens?  Probably the Easel has not been reactivated 
  132. after hitting the OK button.  Only one panel or easel is active at any 
  133. time.  If you see the border of a panel is pink rather than grey then that 
  134. panel is active, rather than the Easel.  You can activate the Easel in 
  135. several ways.  One is to hit the 'See Easel' button on the control panel 
  136. (not available on earliest versions of Istar).  Another is to move over the 
  137. centre of a box on the Easel, press LMB in an attempt to move it - see 8a 
  138. above - and release or hit Escape key.  Anything using LMB over Easel will 
  139. activate it.)
  140.  
  141. 11.  More antecedents.  Draw another couple of boxes (see 4 above) near the 
  142. left-hand box (above or below it) and link these to the right-hand box as 
  143. in 6 above.  The right-most box now has three or more antecedents.  Best 
  144. also to name them with different names as in 8 above.
  145.  
  146. 12.  Running the inference net.  Now click with the Left Mouse Button over 
  147. the centre of the right-hand box.  Up comes a small panel at the top of the 
  148. Control Screen containing a few buttons, the Attribute Action panel.  The 
  149. two buttons on the left are: Reset and Infer, which allow you to run the 
  150. KB.  Hit Reset, then hit Infer.  Up comes a User Question panel, with text 
  151. at the top showing the name/label of one of the antecedent attributes, a 
  152. large central Value gadget, a slider, and an large OK gadget to right, with 
  153. a few others.  Enter a Value by sliding the slider over the the right using 
  154. the LMB and hit OK with LMB.  Then a similar panel should appear for the 
  155. next attribute.  And the next.  If you have three antecedent (left-hand) 
  156. boxes feeding into the consequent (right-hand) one you should get three 
  157. such User Question panels.  (Oops:  No panels come up.  Have you hit Reset 
  158. then Infer?  Oops:  Only one Question panel comes up.  Maybe you have the 
  159. Action panel for one of the antecedent attributes?  A glance at its title 
  160. will give the name/label of the attribute for which it is the Action 
  161. panel.)
  162.  
  163. 12a.  (The meaning of the values given by the sliders will become clear 
  164. when you start the chapter Using Istar.)
  165.  
  166. 13.  Seeing the result.  When the question sequence has finished, the 
  167. Attribute Action panel is still there.  Hit the Data button, and you are 
  168. taken to the Attribute Details panel.  The result should be shown in the 
  169. slider gadget on the second row in the middle - and it should show 
  170. somewhere over to its right end if you slid all the antecedent sliders over 
  171. to the right.
  172.  
  173. 14.  Control Screen.  You can drag the Control Screen up and down using the 
  174. thin white line along its top, just above the strip where the meaning texts 
  175. appear.  Use the tip of the mouse pointer and LMB to do this.  Half way up 
  176. is not a very convenient place, so you can park it by dragging the screen 
  177. down to reveal more of the Easel and hitting the second gadget from the 
  178. left on the Control Screen strip.  This is the parking button.  From then 
  179. on this is where the Control Screen returns to.  Whenever you want to 
  180. access the Control Screen, hit the Gadget showing two arrows at left edge 
  181. of the top strip of the Control Screen.  Up it comes.  Hit it again, and it 
  182. parks back down the bottom.
  183.  
  184. GOING FURTHER STILL - DIFFERENT TYPES
  185.  
  186. 15.  Different item types.  Bring up the control screen.  Look at the KB 
  187. panel.  It has two listview gadgets.  The left-hand of these is a list of 
  188. item types (Free Bayesian, Free Integer, etc.).  Select 'Free Integer' by 
  189. hitting it with the LMB.  Send Control Screen away (hit the left-most two-
  190. arrows button) to reveal the Easel.
  191.  
  192. 16.  Scrollable Easel.  Ensure the Easel is active (step 10a).  Now move 
  193. the mouse over to the right hand side and keep moving.  The Easel scrolls 
  194. smoothly to the left - a tribute to the Amiga's hardware-assisted 
  195. scrolling.  This allows you to traverse a large knowledge base - and, since 
  196. scrolling happens even during drawing, allows you to draw very long links. 
  197. But, for now, we use it to gain empty space for a new inference net.
  198.  
  199. 17a.  Draw a new box on the Easel in some empty space (= step 4) - it 
  200. should say 'Integer' in it and be a different colour from the Bayesian 
  201. boxes you had before.  Give it a name/label of 'Result' (= step 9).
  202.  
  203. 17b.  Draw three antecedent boxes for it (to its left), and link them to 
  204. the Result.  Give them three different names e.g. 'I1', 'I2', 'I3'.  (Note 
  205. that this little inference net is not connected to the earlier one you 
  206. drew.)
  207.  
  208. 18.  Run this wee inference net.  (Step 12: click over Result box with LMB 
  209. to bring up its Action panel and hit Reset then Infer.)  The User Question 
  210. panels will now show, not a slider value gadget, but a rectangle which says 
  211. '0' and into which you can type a number.  In each of the three that comes 
  212. up type a number, say 5, 6 and 7.
  213.  
  214. 19.  Hit the Data button on Result's Action panel, and its Attribute 
  215. Details panel should appear, showing as its value the sum of the numbers 
  216. you entered (18 for the above numbers).
  217.  
  218. 20.  To run it again there is a short cut to the Action panel, the OK-Act 
  219. button near its bottom.  Hit that.  (It short-cuts the process of hitting 
  220. OK and then finding the box and clicking on it with LMB.)  The Attribute 
  221. Action and Attribute Details panels form a pair, and each is accessible 
  222. from the other: the OK-Act button brings up the Action panel and the Data 
  223. button thereon brings up the Details panel.  Run it again, making sure this 
  224. time that the three numbers you enter are all above 1.
  225.  
  226. 21.  Different Inference Method.  When the question sequence has stopped, 
  227. hit the Data button to bring up the Details panel.  On about the fourth row 
  228. you should see a radio button saying 'Inferred' and to its right a string 
  229. in a slot that says "X = A + B, C, ...".  This is the inference method by 
  230. which the values of all the antecedents are combined to give this 
  231. attribute's value.  "X = A + B, C, ..." means "Add all the antecedent 
  232. values together - X refers to this current attribute (labelled 'Result'), A 
  233. refers to the first antecedent, B to the second, and so on.  You can select 
  234. another inference method: attached at the left end of the slot is a wee 
  235. button; hit it with LMB.  Up comes a list of inference methods.  Select 
  236. multiplication, shown by "X = A * B, C, ...".  Hit the OK button on this 
  237. list to send it away, and the string in your slot should be updated 
  238. accordingly.
  239.  
  240. 22.  Now run the inference net again.  (Step 20: notice how convenient the 
  241. OK-Act button is when you are changing things like inference method and 
  242. trying it out.)  Make sure all numbers are above 1.  Look at the Result 
  243. Data.  (If you entered 5, 6, 7 the result value should now be 210.)
  244.  
  245. 23.  Suppressing irrelevant information.  Note that Istar only asks 
  246. questions that it needs to, and thus avoids asking irrelevant ones.  With 
  247. multiplication this happens if one of the antecedents is zero - we then 
  248. know the consequent will be zero, whatever values the remaining antecedents 
  249. take, so there is no point asking them.  Try it: run the inference net 
  250. again (step 20) and enter the second number as 0.  It should not then ask 
  251. the third number.
  252.  
  253. 23a.  (There are various item types for which this effect can occur. 
  254. Integers with multiply, Booleans with AND or OR, and anything with Chooser 
  255. inference method, etc.)
  256.  
  257. 24.  Short-cut to changing item type.  The main way of selecting item type 
  258. for your next box is to bring up the control screen, hit the item type 
  259. listview gadget for the type you want.  A bit of a nuisance; there is a 
  260. short-cut if you have a box of that type already showing on the Easel: 
  261. press 'T' for Type over that box and Istar will select its type.  You have 
  262. two types, Bayesian and Integer, with (Free) Integer currently selected. 
  263. Ensure the Easel is active (step 10a).  Then move the mouse pointer over 
  264. one of your earlier Bayesian boxes and press the T key.  The item type 
  265. should select Free Bayesian.  If you now draw a box it will be of Bayesian 
  266. type.
  267.  
  268. 25.  Automatic Type Conversion.  Find some spare space on the Easel (step 
  269. 16), create a (Free) Probability box to the left and an Integer to the 
  270. right.  Link the Bayesian box as antecedent of the Integer.  Run this 
  271. little inference net; you should be presented with a slider in the User 
  272. Question panel.  Slide the Probability to some suitable number, say 90. 
  273. Look at the value in the Integer attribute; it should say 90 (though early 
  274. versions of Istar might be one out due to rounding errors!).  As far as 
  275. possible Istar intelligently converts from one value type to another.
  276.  
  277. 26.  Some errors.  Don't be scared of errors.  Try experiencing a few 
  278. errors that might happen - if you have not already done so!  Most do not do 
  279. any harm.
  280.  
  281.       #  Separating mouse from link end.  You might have noticed that
  282.       occasionally after starting to draw link the mouse pointer is
  283.       separated slightly from the end of the link.  It happens because
  284.       there is a very slight delay between pressing of LMB and appearance
  285.       of the link, and in this delay the mouse could have moved away
  286.       slightly.  Note that it is the end of the link that is the important,
  287.       active point, not the mouse pointer.  So it is the end of the link
  288.       that should be dropped into the target box, rather than the mouse
  289.       pointer.  Yhis feature is deliberate as it allows the mouse pointer
  290.       to be moved out of the way of the active point, so you can see more
  291.       clearly exactly where the end of the link is going.  Useful in a
  292.       cluttered Easel.  (The same can also happen with drawing boxes,
  293.       bending links, or whatever.)
  294.  
  295.       #  Link not formed.  In drawing a link, if you release LMB such that
  296.       the end of the link is over empty space then it will not be formed -
  297.       because it must link to something.  This can happen when link end and
  298.       pointer are separated and you place the pointer rather than link end
  299.       over the box.
  300.  
  301.       #  Cannot link item to itself.  With any box, start drawing a link
  302.       from its right or left edge but release LMB while the end of the link
  303.       is inside the same box.  An error panel appears.  Hit OK.
  304.  
  305.       #  Cannot create a cycle.  With one of the inference nets you have
  306.       drawn, start drawing a link from the right-hand edge of the right-
  307.       most box and (step 6b) bend it round to the left until it is over one
  308.       of the antecedents, thus creating a cycle in the inference net.  This
  309.       is not allowed; an error panel appears.  Hit OK.
  310.  
  311.       #  Invisible parts of net.  Some keys hide parts of the net.  e.g.
  312.       the A or C keys show antecedents and consequents of a box.  Useful in
  313.       simplifying a large net.  But if hit inadvertently can be confusing
  314.       as you will see links ending in empty space etc.  If this has
  315.       happened then hit the Enter Key on numeric keypad.  This restores
  316.       all.
  317.  
  318.  
  319. WHAT MORE IS THERE?
  320.  
  321. Lots more.  That should more than get you started.  But there's lots more:
  322.  
  323.       #  Larger inference nets
  324.             #  Multi-step
  325.             #  Loop prevention
  326.             #  Scrolling
  327.             #  Zooming
  328.             #  Showing parts
  329.       #  Goal lists
  330.       #  Topics
  331.       #  Find
  332.       #  Forms
  333.       #  Creating new item types, multiple attributes
  334.       #  Creating new attribute types
  335.       #  Document creation
  336.       #  KB Dump, save, load.
  337.       #  etc.
  338.  
  339.  
  340. **  IF YOU WISH, YOU CAN NOW GO STRAIGHT TO <USING ISTAR>.
  341.  
  342.  
  343. STARTING FROM CLI
  344.  
  345. To start Istar from CLI, simply type "Istar", maybe appending the version 
  346. number if there is one.  (I assume that you are familiar with paths etc. or 
  347. how to activate a program in another directory.)
  348.  
  349. Advanced use:
  350.       From CLI you can start with various tracing on, by adding the
  351. parameters:
  352.  
  353.       "-tm" to trace some activity in the modules mechanism
  354.       "-tu" to trace some UA module activity
  355.       "-te" to trace some activity among easels
  356.  
  357. so the command might be:
  358.  
  359.       Istar1.04 -tu -te
  360.  
  361. This will usually only be of value when you suspect some bug and want to 
  362. send me a trace of what happens.
  363.  
  364.  
  365. STARTING WITH LOW MEMORY
  366.  
  367. The standard startup will just about start in a base 2 Mb A1200 as long as 
  368. your Workbench screen is simple PAL 640 by 256 and only 4 colours.  But in 
  369. other situations, from Version 1.04 onwards, you can take action to reduce 
  370. the amount of memory needed for your KB, before you create it.  There are 
  371. two ways of doing this.
  372.  
  373. LOW MEMORY METHOD 1:
  374.  
  375. This method involves starting up and immediately altering some of the 
  376. preferences via the Prefs panel.
  377.  
  378.       #  As soon as the Initial Control Panel comes up, click on the Prefs
  379.       button to bring up the Preferences panel.
  380.  
  381.       #  Alter the MinDSA figure (usually 50000 longwords) to e.g. 10000;
  382.       this reduces the size of a new KB from around 20000 bytes to around
  383.       40000.
  384.  
  385.       #  Alter the size of the Easel from 1920 by 768 to something smaller,
  386.       such as 640 by 256.  If its Depth is shown as 4 or higher reduce it
  387.       to 3.  Doing these reduces the amount of memory for the Easel of a
  388.       new KB.  The original size easel consumes around 200 kbytes for each
  389.       bitplane, whereas 640 by 256 consumes only around 20 kbytes per
  390.       bitplane.
  391.  
  392. Note, though, that you should only do this if you can work with a small KB 
  393. or easel.  Also, doing this will not alter the sizes of KB or easel that 
  394. are loaded from file.
  395.  
  396. LOW MEMORY METHOD 2:
  397.  
  398. Altering the preferences each time you load up can be tedious.  So Istar 
  399. can also load preferences from a file as it enters, which in version 1.04 
  400. is the file IstarSys:IstarPrefs (that is, IstarPrefs in the drawer to which 
  401. IstarSys: is assigned).  So all you need to do is supply such a file, 
  402. according to your needs.
  403.  
  404.       A file, IstarPrefs_LowMem is already supplied, so you need only enter
  405. the following command from a CLI:
  406.  
  407.       COPY IstarSys:IstarPrefs_LowMem IstarSys:IstarPrefs
  408.  
  409. Bring up the Prefs panel to see the sizes it has given you.  If you wish 
  410. anything different then make up your own IstarPrefs file.  There are many 
  411. other Preferences that can be set via this file.  See 'Preferences' section 
  412. in the 'KBs' chapter for details.
  413.  
  414.  
  415. WHAT IS AN ITEM?
  416.  
  417. An item in Istar is some focus of attention in the knowledge base.  It is 
  418. represented on the Easel by a box or group of boxes that move together.  An 
  419. item can have:
  420.  
  421.       #  any number of attributes (so far they have had only 1)
  422.       #  relationships to other items
  423.  
  424. On the Item Type list on the KB panel, select 'Contract Meaning'.  This is 
  425. an item expressed by two boxes, when you draw it on the Easel.  The top one 
  426. represents the item itself, the bottom one an attribute of the item.
  427.  
  428.       You can define your own item types.  Let's try doing so.  Hit the
  429. 'New' button below the Item Type list.  A new panel, Create New Item Type 
  430. (CNIT) comes up for an item type called 'Unnamed'.  Change the name to 
  431. 'Employee'.
  432.  
  433.       Now we will add attributes to the item type.  To add each attribute
  434. to an item type we do three things:
  435.  
  436.       1.  Set the type
  437.       2.  Set the name
  438.       3.  Click the addition button just above the Type.
  439.  
  440. So first, hit the Type wee button, and select String from the list that 
  441. comes up; hit its OK button.  Then in the Attribute name to the left of the 
  442. Type, enter 'Name'.  Now hit the button above Type.  'Name' will appear in 
  443. the list in the middle of the panel.  Now create an attribute called 'Age', 
  444. of type Integer using the same steps.  Now create an attribute called 'Day 
  445. off' of Type 'Weekdays'.  Lastly, create an attribute called 'Salary' of 
  446. Type Integer.
  447.  
  448.       Then press OK (called Done in some versions) on the CNIT panel, and
  449. it disappears.  Look at the SIT panel and you will see 'Employee' has been 
  450. added at the bottom and should be selected (if not, select it).
  451.  
  452.       Now draw on the Easel and you should get a tall box group with five
  453. boxes: a smaller one at the top representing the employee itself, with four 
  454. attribute boxes: Name, Age, Day off, Salary.
  455.  
  456.       Notice the similarity to databases: item = entity or record,
  457. attribute = attribute or field.  Unlike many databases new item types can 
  458. be created at any time.  And (probably not this version) new attributes can 
  459. be added to existing item types.
  460.  
  461.  
  462. WHAT IS AN ATTRIBUTE?
  463.  
  464. An attribute is a holder of a value - such as Name, Age, etc.  It can be of 
  465. two types: in an item or a free attribute.  Each attribute is expressed by 
  466. a box.  When you started above, you were drawing (creating) free 
  467. attributes.  When you drew the Employee box group you created an item with 
  468. for attributes.  Free attributes actually belong to a hidden item, for 
  469. which there is no visible box.
  470.  
  471.       Attributes can be of a variety of types, which normally are defined
  472. in terms of value types (see below).
  473.  
  474.       It became clear during the INCA research project that the
  475. conventional picture, of items with several attributes, was not always 
  476. appropriate.  In an inference net a lot of items exist merely to support a 
  477. single attribute, and so Istar developed the idea of 'free attributes', in 
  478. which the item is still there for structural purposes but is de-emphasized 
  479. and not shown on the easel.  So in the Select Item Type panel the first set 
  480. of items is normally a load of free attributes.  They are represented by 
  481. single boxes.  Whether they are called attributes or items is immaterial.
  482.  
  483.  
  484. Copyright (c) Andrew Basden, 1996
  485.